﻿using System;
using NUnit;
using NUnit.Framework;
using System.Drawing;
using System.IO;
namespace RecognitionEngineTests
{
    [TestFixture]
    public class ANPRMXTests
    {
        ANPRMXEngine.ANPRMXRecEngine engine;
        Bitmap sample;


        [SetUp]
        public void Setup()
        {
            engine = new ANPRMXEngine.ANPRMXRecEngine();
            sample = new Bitmap(Path.Combine(Directory.GetCurrentDirectory(), "DSCF9719.JPG"));

            engine.GetPlateNum(sample);
        }

        [Test]
        public void GivenAValidImage_WhenGetPlateNumCalled_RecEngineShouldReturnthePlateNUm()
        {
            string plate = engine.GetPlateNum(sample);

            Assert.IsTrue(plate != null);
        }

        [Test]
        public void GivenAValidImage_WhenGetPlateAlternates_RecEngineShouldReturnAPopulatedStringArray()
        {
            string[] alts = engine.GetAlternateMatches();
            
            Assert.IsNotEmpty(alts);
        }

        [Test]
        public void GivenAValidImage_WhenGetPlatePatch_RecEngineShouldReturnAnImage()
        {
            Bitmap patch = engine.GetPlatePatch();

            Assert.IsNotNull(patch);
        }
    }
}
